package com.ask.service.utilService;

import com.ask.dto.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class TopService {

    @Autowired
    private RedisTemplate redisTemplate;
    public void save(Long gameId, Long userId, double score) {
        String key = "leaderboard:" + gameId;
        redisTemplate.opsForZSet().add(key,userId, score);
    }
}
